import { Sort } from '../../sort/entities/sort.entity';
import { Tag } from '../../tag/entities/tag.entity';

// create-article.dto.ts
import { ApiProperty } from '@nestjs/swagger';
import { User } from '../../users/entities/user.entity';

export class CreateArticleDto {
  @ApiProperty({
    description: '文章标题',
    example: '探索NestJS的高级特性',
  })
  title: string;

  @ApiProperty({
    description: '作者名称',
    example: '张三',
  })
  author: User;

  @ApiProperty({
    description: '封面图片URL（可选）',
    example:
      'https://img.zcool.cn/community/01401d5b56bd1aa80121ade006e914.jpg@1280w_1l_2o_100sh.jpg',
  })
  cover?: string;

  @ApiProperty({
    description: '文章内容',
    example: '这里是文章的详细内容...',
  })
  content: string;

  @ApiProperty({
    description: '点赞数',
    example: 100,
  })
  likes: number;

  @ApiProperty({
    description: '浏览数',
    example: 1000,
  })
  views: number;

  @ApiProperty({
    description: '文章分类（可选）',
    // 假设Sort是一个已经定义好的实体或DTO
    type: Sort,
    required: false,
  })
  sort?: Sort;

  @ApiProperty({
    description: '文章标签列表（可选）',
    // 假设Tag是一个已经定义好的实体或DTO
    type: [Tag],
    required: false,
  })
  tags?: Tag[];

  @ApiProperty({
    description: '作者id',
    required: true,
  })
  authorId?: string;
}
